package com.wuye.repository;

import com.wuye.model.WeixinToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;


/**
 * 微信验证token
 * Created by jiawenlong on 2015/10/15.
 */
public interface WeixinTokenRepository extends JpaRepository<WeixinToken,String>,PagingAndSortingRepository<WeixinToken,String> {
    WeixinToken findById(long id);
    List<WeixinToken> findAll();
    @Query(nativeQuery = true, value = "select * from WeixinToken Order by createTime desc limit 0,1")
    WeixinToken findLastToken();
}
